Optimal. Leaf size=64 \[ \frac {b^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{a^{3/2} f (a-b)}-\frac {x}{a-b}-\frac {\cot (e+f x)}{a f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 64, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3670, 480, 522, 203, 205} \[ \frac {b^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{a^{3/2} f (a-b)}-\frac {x}{a-b}-\frac {\cot (e+f x)}{a f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 205
Rule 480
Rule 522
Rule 3670
Rubi steps
\begin {align*} \int \frac {\cot ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {1}{x^2 \left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {\cot (e+f x)}{a f}+\frac {\operatorname {Subst}\left (\int \frac {-a-b-b x^2}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{a f}\\ &=-\frac {\cot (e+f x)}{a f}-\frac {\operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{(a-b) f}+\frac {b^2 \operatorname {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\tan (e+f x)\right )}{a (a-b) f}\\ &=-\frac {x}{a-b}+\frac {b^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{a^{3/2} (a-b) f}-\frac {\cot (e+f x)}{a f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.26, size = 68, normalized size = 1.06 \[ \frac {b^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )-\sqrt {a} ((a-b) \cot (e+f x)+a (e+f x))}{a^{3/2} f (a-b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 243, normalized size = 3.80 \[ \left [-\frac {4 \, a f x \tan \left (f x + e\right ) + b \sqrt {-\frac {b}{a}} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{4} - 6 \, a b \tan \left (f x + e\right )^{2} + a^{2} - 4 \, {\left (a b \tan \left (f x + e\right )^{3} - a^{2} \tan \left (f x + e\right )\right )} \sqrt {-\frac {b}{a}}}{b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}}\right ) \tan \left (f x + e\right ) + 4 \, a - 4 \, b}{4 \, {\left (a^{2} - a b\right )} f \tan \left (f x + e\right )}, -\frac {2 \, a f x \tan \left (f x + e\right ) - b \sqrt {\frac {b}{a}} \arctan \left (\frac {{\left (b \tan \left (f x + e\right )^{2} - a\right )} \sqrt {\frac {b}{a}}}{2 \, b \tan \left (f x + e\right )}\right ) \tan \left (f x + e\right ) + 2 \, a - 2 \, b}{2 \, {\left (a^{2} - a b\right )} f \tan \left (f x + e\right )}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 2.48, size = 86, normalized size = 1.34 \[ \frac {\frac {{\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (b) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )\right )} b^{2}}{{\left (a^{2} - a b\right )} \sqrt {a b}} - \frac {f x + e}{a - b} - \frac {1}{a \tan \left (f x + e\right )}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.61, size = 73, normalized size = 1.14 \[ \frac {b^{2} \arctan \left (\frac {\tan \left (f x +e \right ) b}{\sqrt {a b}}\right )}{f a \left (a -b \right ) \sqrt {a b}}-\frac {1}{f a \tan \left (f x +e \right )}-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{f \left (a -b \right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.07, size = 65, normalized size = 1.02 \[ \frac {\frac {b^{2} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )}{{\left (a^{2} - a b\right )} \sqrt {a b}} - \frac {f x + e}{a - b} - \frac {1}{a \tan \left (f x + e\right )}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 11.77, size = 438, normalized size = 6.84 \[ \frac {a^2\,b-a^3}{f\,\left (a^4\,\mathrm {tan}\left (e+f\,x\right )-a^3\,b\,\mathrm {tan}\left (e+f\,x\right )\right )}+\frac {\mathrm {atan}\left (\frac {a^6\,b\,\mathrm {tan}\left (e+f\,x\right )\,\sqrt {-a^3\,b^3}\,1{}\mathrm {i}-a^3\,b^4\,\mathrm {tan}\left (e+f\,x\right )\,\sqrt {-a^3\,b^3}\,1{}\mathrm {i}}{a^5\,b^5-a^8\,b^2}\right )\,\sqrt {-a^3\,b^3}\,1{}\mathrm {i}-a^3\,\mathrm {atan}\left (\frac {\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,a^5\,b^3+2\,a^3\,b^5\right )+\frac {\left (4\,a^5\,b^4-4\,a^4\,b^5+4\,a^6\,b^3-4\,a^7\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (8\,a^8\,b^2-8\,a^7\,b^3-8\,a^6\,b^4+8\,a^5\,b^5\right )\,1{}\mathrm {i}}{2\,a-2\,b}\right )\,1{}\mathrm {i}}{2\,a-2\,b}}{2\,a-2\,b}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,a^5\,b^3+2\,a^3\,b^5\right )+\frac {\left (4\,a^4\,b^5-4\,a^5\,b^4-4\,a^6\,b^3+4\,a^7\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (8\,a^8\,b^2-8\,a^7\,b^3-8\,a^6\,b^4+8\,a^5\,b^5\right )\,1{}\mathrm {i}}{2\,a-2\,b}\right )\,1{}\mathrm {i}}{2\,a-2\,b}}{2\,a-2\,b}}{2\,a^5\,b^2+2\,a^4\,b^3+2\,a^3\,b^4}\right )}{f\,\left (a^3\,b-a^4\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 14.92, size = 570, normalized size = 8.91 \[ \begin {cases} \tilde {\infty } x & \text {for}\: a = 0 \wedge b = 0 \wedge e = 0 \wedge f = 0 \\\frac {x + \frac {1}{f \tan {\left (e + f x \right )}} - \frac {1}{3 f \tan ^{3}{\left (e + f x \right )}}}{b} & \text {for}\: a = 0 \\- \frac {3 f x \tan ^{3}{\left (e + f x \right )}}{2 b f \tan ^{3}{\left (e + f x \right )} + 2 b f \tan {\left (e + f x \right )}} - \frac {3 f x \tan {\left (e + f x \right )}}{2 b f \tan ^{3}{\left (e + f x \right )} + 2 b f \tan {\left (e + f x \right )}} - \frac {3 \tan ^{2}{\left (e + f x \right )}}{2 b f \tan ^{3}{\left (e + f x \right )} + 2 b f \tan {\left (e + f x \right )}} - \frac {2}{2 b f \tan ^{3}{\left (e + f x \right )} + 2 b f \tan {\left (e + f x \right )}} & \text {for}\: a = b \\\frac {\tilde {\infty } x}{a} & \text {for}\: e = - f x \\\frac {x \cot ^{2}{\relax (e )}}{a + b \tan ^{2}{\relax (e )}} & \text {for}\: f = 0 \\\frac {- x - \frac {\cot {\left (e + f x \right )}}{f}}{a} & \text {for}\: b = 0 \\- \frac {2 i a^{\frac {3}{2}} f x \sqrt {\frac {1}{b}} \tan {\left (e + f x \right )}}{2 i a^{\frac {5}{2}} f \sqrt {\frac {1}{b}} \tan {\left (e + f x \right )} - 2 i a^{\frac {3}{2}} b f \sqrt {\frac {1}{b}} \tan {\left (e + f x \right )}} - \frac {2 i a^{\frac {3}{2}} \sqrt {\frac {1}{b}}}{2 i a^{\frac {5}{2}} f \sqrt {\frac {1}{b}} \tan {\left (e + f x \right )} - 2 i a^{\frac {3}{2}} b f \sqrt {\frac {1}{b}} \tan {\left (e + f x \right )}} + \frac {2 i \sqrt {a} b \sqrt {\frac {1}{b}}}{2 i a^{\frac {5}{2}} f \sqrt {\frac {1}{b}} \tan {\left (e + f x \right )} - 2 i a^{\frac {3}{2}} b f \sqrt {\frac {1}{b}} \tan {\left (e + f x \right )}} + \frac {b \log {\left (- i \sqrt {a} \sqrt {\frac {1}{b}} + \tan {\left (e + f x \right )} \right )} \tan {\left (e + f x \right )}}{2 i a^{\frac {5}{2}} f \sqrt {\frac {1}{b}} \tan {\left (e + f x \right )} - 2 i a^{\frac {3}{2}} b f \sqrt {\frac {1}{b}} \tan {\left (e + f x \right )}} - \frac {b \log {\left (i \sqrt {a} \sqrt {\frac {1}{b}} + \tan {\left (e + f x \right )} \right )} \tan {\left (e + f x \right )}}{2 i a^{\frac {5}{2}} f \sqrt {\frac {1}{b}} \tan {\left (e + f x \right )} - 2 i a^{\frac {3}{2}} b f \sqrt {\frac {1}{b}} \tan {\left (e + f x \right )}} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________